#include <stdio.h>

int main(int argc, char *argv[])
{
    int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};

    int *p = arr;
    int *q = arr;
    int len = sizeof(arr) / sizeof(arr[0]);

    for (int i = 0; i < len; i++) {
        printf("%d ", arr[i]);
        q++; 
    }
    
    q--;

    puts("");

    while(q > p) {
        int tmp = *p;
        *p = *q;
        *q = tmp;

        q--;
        p++;
    }
    
    for (int i = 0; i < len; i++) {
       printf("%d ", *(arr + i)); 
    }

    puts("");

    return 0;
}
